<?php

class Archive 
{
	function Archive() 
	{
		//should paginate it?
	}
	
	function displayArchive($year,$month)
	{
		$query = "Select id,title,body,date,catid from posts WHERE year(date)=$year AND month(date)=$month AND state = 0 ORDER BY date DESC";
		 
		//'Select distinct year(date),monthname(date),month(date) from posts ORDER BY date DESC';
		
		//rezultati iskanja
		$result = getFullAssoc($query);
		
		//ven dobi asociativno polje
		foreach($result as $row)
		{
			$pos = new Post();
			$pos->setData($row);
			$pos->getNumComments();
			$pos->getCategory();
			
			$pos->displayPost();
		}
	}
	
}

?>